//
//  HMDoctorListModel.m
//  仿真项目开发
//
//  Created by LZH on 2017/3/22.
//  Copyright © 2017年 B.HOPE. All rights reserved.
//

#import "HMDoctorListModel.h"
#import "YYModel.h"
#import "HMTool.h"

@implementation HMDoctorListModel


+(void)getDocListDataWithURLString:(NSString *)URLString
                        andParameters:(NSDictionary *)parameters
                      andSuccessBlock:(void(^)(NSArray *newsList))successBlock andErrorBlock:(void(^)(NSError *error))errorBlock{
    
    [[HMTool sharedNetworkTool] POSTWithURLString:URLString parameters:parameters success:^(id responseObject) {
       
        // 通过key取出字典数组
        NSDictionary *jsons = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
        NSArray *dictArr = jsons[@"data"];
        
        
        // 使用YYModel把字典数组转模型数组
        NSArray *newsList = [NSArray yy_modelArrayWithClass:[HMDoctorListModel class] json:dictArr];
       
        if (successBlock) {
            successBlock(newsList);
        }
    } faile:^(NSError *error) {
        if (errorBlock) {
            errorBlock(error);
        }
    }];
}


//
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{}
@end
